package com.example.springbootsfzy.controller.liujinping;

import com.example.springbootsfzy.util.SendSmsUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Component;

@Component
public class Send {
    @Autowired
    private JavaMailSender mailSender;
    @Value("${spring.mail.from}")
    private  String  from;
    void sendEmail() {
        String  to="3463996275@qq.com";
        //3463996275@qq.com
        String  subject="oioioi";
        String  text="oioioioioi";

        //邮件内容
        SimpleMailMessage message = new SimpleMailMessage();
        message.setFrom(from);
        message.setTo(to);
        message.setSubject(subject);
        message.setText(text);
        //发送
        mailSender.send(message);
    }
    void test4(){
        String[] phoneNumbers={"13223733351","18781949270"};
        String code ="54188";
        SendSmsUtil.sendSms(phoneNumbers,code);
    }
}
